package com.cn.springcloudwechat.mapper.mapper.articleAndMenu;


import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.articleAndMenu.YmScrollArticle;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: YmScrollArticleMapper
 * @author: Administrator
 * @create: 2018-07-18 15:10
 */
@Repository
public interface YmScrollArticleMapper {


    /**
     * 添加轮播文章
     *
     * @param record
     * @return
     */
    long insertSelective(YmScrollArticle record);

    /**
     * 查询某个轮播文章
     *
     * @param scrollArticleId
     * @return
     */
    YmScrollArticle selectByPrimaryKey(Long scrollArticleId);

    /**
     * 更新文章
     *
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(YmScrollArticle record);


    /**
     * 查询文章
     *
     * @param scrollType
     * @return
     */
    List<YmScrollArticle> getScrollArticle(@Param("scrollType") Integer scrollType);

    /**
     * 批量更新轮播图状态
     *
     * @param scollArticleId
     * @param state
     */
    void updateScollArticleId(@Param("list") List<Long> scollArticleId, @Param("state") short state);

    /**
     * 根据条件查询 轮播图数据
     *
     * @param record
     * @param page
     * @return
     */
    List<Object> getScrollArticleByParameter(@Param("record") YmScrollArticle record, Page<Object> page);


}